package com.cropdoctor.model.constants;

import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

/*分页查询结果模型类*/
@Data
@ToString
public class PageResult<T> implements Serializable {

    // 数据列表
    private List<T> data;

    //总记录数
    private long total;

    //当前页码
    private long page;

    //每页记录数
    private long pageSize;

    public PageResult(List<T> data, long total, long page, long pageSize) {
        this.data = data;
        this.total = total;
        this.page = page;
        this.pageSize = pageSize;
    }
}